#define  _COMMON_FUNC_GLOBAL_
#include "config.h"

void EIC_IRQ_DisableINT_All(void)
{
	if (EIC_IRQ_DIScnt == 0) {
		__set_PRIMASK(1);
	} 
	
	EIC_IRQ_DIScnt++;
}

void EIC_IRQ_EnableINT_All(void) 
{
	EIC_IRQ_DIScnt --; 
	if (EIC_IRQ_DIScnt == 0) {
		__set_PRIMASK(0); 
	}
}

U32 forU8ToU32LSB(U8 *p)
{
	U32 iTemp = 0;
	iTemp = (p[3] << 24) + (p[2] << 16) + (p[1] << 8) + p[0];
	return iTemp;
}

void forU32TopU8LSB(U32 data,U8 *p)
{
	p[0] = data;
	data = data >> 8;p[1] = data;
	data = data >> 8;p[2] = data;
	data = data >> 8;p[3] = data;
}

UINT querryDifferenceSize(UINT a,UINT b)
{
	if (a >= b)
	{
		return a-b;
	}
	else
	{
		return b-a;
	}
}

